package com.post.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Tshuangchuang entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tshuangchuang", catalog = "cwfx")
public class Tshuangchuang implements java.io.Serializable {

	// Fields

	private String cid;
	private Tdept tdept;
	private String cname;
	private Date cstartdate;
	private Date cenddate;
	private Integer cstatus;
	private Set<Tcost> tcosts = new HashSet<Tcost>(0);

	// Constructors

	/** default constructor */
	public Tshuangchuang() {
	}

	/** minimal constructor */
	public Tshuangchuang(String cid) {
		this.cid = cid;
	}

	/** full constructor */
	public Tshuangchuang(String cid, Tdept tdept, String cname, Date cstartdate, Date cenddate, Integer cstatus, Set<Tcost> tcosts) {
		this.cid = cid;
		this.tdept = tdept;
		this.cname = cname;
		this.cstartdate = cstartdate;
		this.cenddate = cenddate;
		this.cstatus = cstatus;
		this.tcosts = tcosts;
	}

	// Property accessors
	@Id
	@Column(name = "CID", unique = true, nullable = false, length = 36)
	public String getCid() {
		return this.cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CDEPTID")
	public Tdept getTdept() {
		return this.tdept;
	}

	public void setTdept(Tdept tdept) {
		this.tdept = tdept;
	}

	@Column(name = "CNAME", length = 100)
	public String getCname() {
		return this.cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "CSTARTDATE", length = 10)
	public Date getCstartdate() {
		return this.cstartdate;
	}

	public void setCstartdate(Date cstartdate) {
		this.cstartdate = cstartdate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "CENDDATE", length = 10)
	public Date getCenddate() {
		return this.cenddate;
	}

	public void setCenddate(Date cenddate) {
		this.cenddate = cenddate;
	}

	@Column(name = "CSTATUS")
	public Integer getCstatus() {
		return this.cstatus;
	}

	public void setCstatus(Integer cstatus) {
		this.cstatus = cstatus;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tshuangchuang")
	public Set<Tcost> getTcosts() {
		return this.tcosts;
	}

	public void setTcosts(Set<Tcost> tcosts) {
		this.tcosts = tcosts;
	}

}